from pages.base_page import BasePage
from selenium.webdriver.common.by import By

from pages.product_page import ProductPage


class MainPage(BasePage):
    __LOGIN_BTN = By.XPATH,'//span[text()="登录"]'
    __PRODUCT_PAGE = By.XPATH, '//li[@title="商品"]'
    def __init__(self):
        BasePage.__init__(self)
        self.driver.get("https://v4.crmeb.net/admin/login")
        self.driver.find_element(*self.__LOGIN_BTN).click()

    def go_to_product(self):
        self.driver.find_element(*self.__PRODUCT_PAGE).click()
        return ProductPage()